package com.hspedu.exception_.ClassExercise;

/**
 * @Author Stringzhua
 * @Date 2024/3/7 21:44
 * description:
 */
public class Exercise01 {
    public static void main(String[] args) {
//        01
        String friends[] = {"tom", "jack", "milan"};
        for (int i = 0; i < 4; i++) {
            System.out.println(friends[i]);//ArrayIndexOutOfBoundsException数组下标越界异常
// 出现:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
        }
//        02
//        Cat c=new Cat();
//        cat=null;
//        System.out.println(cat.name);//NullPointerException空指针异常
    }
}

